// File generated from our OpenAPI spec by Stainless.

package com.metest.api.models.rest.actuator

import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.metest.api.core.JsonValue
import com.metest.api.core.jsonMapper
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class ActuatorRetrieveResponseTest {

    @Test
    fun create() {
        val actuatorRetrieveResponse =
            ActuatorRetrieveResponse.builder()
                .putAdditionalProperty(
                    "foo",
                    JsonValue.from(mapOf("foo" to mapOf("href" to "href", "templated" to true))),
                )
                .build()
    }

    @Test
    fun roundtrip() {
        val jsonMapper = jsonMapper()
        val actuatorRetrieveResponse =
            ActuatorRetrieveResponse.builder()
                .putAdditionalProperty(
                    "foo",
                    JsonValue.from(mapOf("foo" to mapOf("href" to "href", "templated" to true))),
                )
                .build()

        val roundtrippedActuatorRetrieveResponse =
            jsonMapper.readValue(
                jsonMapper.writeValueAsString(actuatorRetrieveResponse),
                jacksonTypeRef<ActuatorRetrieveResponse>(),
            )

        assertThat(roundtrippedActuatorRetrieveResponse).isEqualTo(actuatorRetrieveResponse)
    }
}
